﻿<Activity mc:Ignorable="sap sap2010 sads" x:Class="StateMachineActivityLibrary.StateMachineWithDecision"
 xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
 xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 xmlns:mca="clr-namespace:Microsoft.CSharp.Activities;assembly=System.Activities"
 xmlns:p="http://schemas.microsoft.com/workflow/2012/07/xaml/activities"
 xmlns:p1="wf://workflow.windows.net/$Current/$Activities"
 xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
 xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
 xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
 xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
 xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <x:Members>
    <x:Property Name="Id" Type="InArgument(x:String)" />
    <x:Property Name="NeedForApproval" Type="InArgument(x:String)" />
  </x:Members>
  <sap2010:ExpressionActivityEditor.ExpressionActivityEditor>C#</sap2010:ExpressionActivityEditor.ExpressionActivityEditor>
  <sap2010:WorkflowViewState.IdRef>StateMachineActivityLibrary.StateMachineWithDecision_1</sap2010:WorkflowViewState.IdRef>
  <TextExpression.NamespacesForImplementation>
    <sco:Collection x:TypeArguments="x:String">
      <x:String>System</x:String>
      <x:String>System.Collections.Generic</x:String>
      <x:String>System.Data</x:String>
      <x:String>System.Linq</x:String>
      <x:String>System.Text</x:String>
      <x:String>Microsoft.Activities.Messaging</x:String>
      <x:String>System.Collections.ObjectModel</x:String>
    </sco:Collection>
  </TextExpression.NamespacesForImplementation>
  <TextExpression.ReferencesForImplementation>
    <sco:Collection x:TypeArguments="AssemblyReference">
      <AssemblyReference>Microsoft.Activities</AssemblyReference>
      <AssemblyReference>Microsoft.CSharp</AssemblyReference>
      <AssemblyReference>System</AssemblyReference>
      <AssemblyReference>System.Activities</AssemblyReference>
      <AssemblyReference>System.Core</AssemblyReference>
      <AssemblyReference>System.Data</AssemblyReference>
      <AssemblyReference>System.Runtime.Serialization</AssemblyReference>
      <AssemblyReference>System.ServiceModel</AssemblyReference>
      <AssemblyReference>System.ServiceModel.Activities</AssemblyReference>
      <AssemblyReference>System.Xaml</AssemblyReference>
      <AssemblyReference>System.Xml</AssemblyReference>
      <AssemblyReference>System.Xml.Linq</AssemblyReference>
      <AssemblyReference>mscorlib</AssemblyReference>
      <AssemblyReference>StateMachineActivityLibrary</AssemblyReference>
    </sco:Collection>
  </TextExpression.ReferencesForImplementation>
  <StateMachine sap2010:WorkflowViewState.IdRef="StateMachineWithDecision_1">
    <StateMachine.InitialState>
      <State x:Name="__ReferenceID1" DisplayName="Draft" sap2010:WorkflowViewState.IdRef="State_3">
        <State.Entry>
          <Sequence sap2010:WorkflowViewState.IdRef="Sequence_1">
            <Assign sap2010:WorkflowViewState.IdRef="Assign_1">
              <Assign.To>
                <OutArgument x:TypeArguments="x:String">
                  <p:ExternalVariableReference x:TypeArguments="x:String" Name="StateMachineId" />
                </OutArgument>
              </Assign.To>
              <Assign.Value>
                <InArgument x:TypeArguments="x:String">
                  <mca:CSharpValue x:TypeArguments="x:String">Id</mca:CSharpValue>
                </InArgument>
              </Assign.Value>
            </Assign>
            <p:SetUserStatus Description="Draft" sap2010:WorkflowViewState.IdRef="SetUserStatus_1" />
          </Sequence>
        </State.Entry>
        <State.Transitions>
          <Transition DisplayName="Close" sap2010:WorkflowViewState.IdRef="Transition_6">
            <Transition.Trigger>
              <Switch x:TypeArguments="x:String" x:Name="__ReferenceID0" sap2010:WorkflowViewState.IdRef="Switch`1_1">
                <Switch.Default>
                  <p1:SubscribeNotification EventNameFilter="Submit" sap2010:WorkflowViewState.IdRef="SubscribeNotification_4">
                    <p1:SubscribeNotification.FilterId>
                      <InArgument x:TypeArguments="x:String">
                        <mca:CSharpValue x:TypeArguments="x:String">Id</mca:CSharpValue>
                      </InArgument>
                    </p1:SubscribeNotification.FilterId>
                    <p1:SubscribeNotification.condition>
                      <OutArgument x:TypeArguments="x:String">
                        <mca:CSharpReference x:TypeArguments="x:String">condition</mca:CSharpReference>
                      </OutArgument>
                    </p1:SubscribeNotification.condition>
                  </p1:SubscribeNotification>
                </Switch.Default>
                <Switch.Expression>
                  <InArgument x:TypeArguments="x:String">
                    <mca:CSharpValue x:TypeArguments="x:String">NeedForApproval</mca:CSharpValue>
                  </InArgument>
                </Switch.Expression>
                <Assign x:Key="N" sap2010:WorkflowViewState.IdRef="Assign_2">
                  <Assign.To>
                    <OutArgument x:TypeArguments="x:Boolean">
                      <mca:CSharpReference x:TypeArguments="x:Boolean">closing</mca:CSharpReference>
                    </OutArgument>
                  </Assign.To>
                  <Assign.Value>
                    <InArgument x:TypeArguments="x:Boolean">True</InArgument>
                  </Assign.Value>
                </Assign>
              </Switch>
            </Transition.Trigger>
            <Transition.Condition>
              <mca:CSharpValue x:TypeArguments="x:Boolean">closing</mca:CSharpValue>
            </Transition.Condition>
            <Transition.To>
              <State x:Name="__ReferenceID2" DisplayName="Approved" sap2010:WorkflowViewState.IdRef="State_1" IsFinal="True">
                <State.Entry>
                  <p:SetUserStatus Description="Approved" sap2010:WorkflowViewState.IdRef="SetUserStatus_3" />
                </State.Entry>
              </State>
            </Transition.To>
          </Transition>
          <Transition Trigger="{x:Reference __ReferenceID0}" DisplayName="Submit" sap2010:WorkflowViewState.IdRef="Transition_3">
            <Transition.Condition>
              <mca:CSharpValue x:TypeArguments="x:Boolean">condition != "Y"</mca:CSharpValue>
            </Transition.Condition>
            <Transition.To>
              <State x:Name="__ReferenceID4" DisplayName="Sumitted" sap2010:WorkflowViewState.IdRef="State_2">
                <State.Entry>
                  <p:SetUserStatus Description="Submitted" sap2010:WorkflowViewState.IdRef="SetUserStatus_2" />
                </State.Entry>
                <State.Transitions>
                  <Transition DisplayName="Reject" sap2010:WorkflowViewState.IdRef="Transition_1">
                    <Transition.Trigger>
                      <p1:SubscribeNotification condition="{x:Null}" EventNameFilter="Reject" sap2010:WorkflowViewState.IdRef="SubscribeNotification_2">
                        <p1:SubscribeNotification.FilterId>
                          <InArgument x:TypeArguments="x:String">
                            <mca:CSharpValue x:TypeArguments="x:String">Id</mca:CSharpValue>
                          </InArgument>
                        </p1:SubscribeNotification.FilterId>
                      </p1:SubscribeNotification>
                    </Transition.Trigger>
                    <Transition.To>
                      <x:Reference>__ReferenceID1</x:Reference>
                    </Transition.To>
                  </Transition>
                  <Transition DisplayName="Approve" sap2010:WorkflowViewState.IdRef="Transition_2">
                    <Transition.Trigger>
                      <p1:SubscribeNotification condition="{x:Null}" EventNameFilter="Approve" sap2010:WorkflowViewState.IdRef="SubscribeNotification_3">
                        <p1:SubscribeNotification.FilterId>
                          <InArgument x:TypeArguments="x:String">
                            <mca:CSharpValue x:TypeArguments="x:String">Id</mca:CSharpValue>
                          </InArgument>
                        </p1:SubscribeNotification.FilterId>
                      </p1:SubscribeNotification>
                    </Transition.Trigger>
                    <Transition.To>
                      <x:Reference>__ReferenceID2</x:Reference>
                    </Transition.To>
                  </Transition>
                  <Transition DisplayName="Cancel">
                    <Transition.Trigger>
                      <p1:SubscribeNotification EventNameFilter="Cancel">
                        <p1:SubscribeNotification.FilterId>
                          <InArgument x:TypeArguments="x:String">
                            <mca:CSharpValue x:TypeArguments="x:String">Id</mca:CSharpValue>
                          </InArgument>
                        </p1:SubscribeNotification.FilterId>
                        <p1:SubscribeNotification.condition>
                          <OutArgument x:TypeArguments="x:String">
                            <mca:CSharpReference x:TypeArguments="x:String">condition</mca:CSharpReference>
                          </OutArgument>
                        </p1:SubscribeNotification.condition>
                        <sap2010:WorkflowViewState.IdRef>SubscribeNotification_5</sap2010:WorkflowViewState.IdRef>
                      </p1:SubscribeNotification>
                    </Transition.Trigger>
                    <Transition.To>
                      <State x:Name="__ReferenceID3" DisplayName="Cancelled" IsFinal="True">
                        <State.Entry>
                          <p:SetUserStatus Description="Cancelled" sap2010:WorkflowViewState.IdRef="SetUserStatus_4" />
                        </State.Entry>
                        <sap2010:WorkflowViewState.IdRef>State_4</sap2010:WorkflowViewState.IdRef>
                      </State>
                    </Transition.To>
                    <sap2010:WorkflowViewState.IdRef>Transition_7</sap2010:WorkflowViewState.IdRef>
                  </Transition>
                </State.Transitions>
              </State>
            </Transition.To>
          </Transition>
          <Transition Trigger="{x:Reference __ReferenceID0}" DisplayName="Approve" sap2010:WorkflowViewState.IdRef="Transition_4" To="{x:Reference __ReferenceID2}">
            <Transition.Condition>
              <mca:CSharpValue x:TypeArguments="x:Boolean">condition == "Y"</mca:CSharpValue>
            </Transition.Condition>
          </Transition>
          <Transition DisplayName="Cancel">
            <Transition.Trigger>
              <p1:SubscribeNotification EventNameFilter="Cancel">
                <p1:SubscribeNotification.FilterId>
                  <InArgument x:TypeArguments="x:String">
                    <mca:CSharpValue x:TypeArguments="x:String">Id</mca:CSharpValue>
                  </InArgument>
                </p1:SubscribeNotification.FilterId>
                <p1:SubscribeNotification.condition>
                  <OutArgument x:TypeArguments="x:String">
                    <mca:CSharpReference x:TypeArguments="x:String">condition</mca:CSharpReference>
                  </OutArgument>
                </p1:SubscribeNotification.condition>
                <sap2010:WorkflowViewState.IdRef>SubscribeNotification_6</sap2010:WorkflowViewState.IdRef>
              </p1:SubscribeNotification>
            </Transition.Trigger>
            <Transition.To>
              <x:Reference>__ReferenceID3</x:Reference>
            </Transition.To>
            <sap2010:WorkflowViewState.IdRef>Transition_8</sap2010:WorkflowViewState.IdRef>
          </Transition>
        </State.Transitions>
        <State.Variables>
          <Variable x:TypeArguments="x:Boolean" Default="False" Name="closing" />
        </State.Variables>
      </State>
    </StateMachine.InitialState>
    <x:Reference>__ReferenceID1</x:Reference>
    <x:Reference>__ReferenceID4</x:Reference>
    <x:Reference>__ReferenceID2</x:Reference>
    <x:Reference>__ReferenceID3</x:Reference>
    <StateMachine.Variables>
      <Variable x:TypeArguments="p:SubscriptionHandle" Name="subscription" />
      <Variable x:TypeArguments="p:SubscriptionFilter" Name="filter" />
      <Variable x:TypeArguments="x:String" Name="condition" />
    </StateMachine.Variables>
    <sads:DebugSymbol.Symbol>d2FDOlxDb2RlcGxleFxTdGF0ZU1hY2hpbmVXb3JrZmxvd01hbmFnZXJcU3RhdGVNYWNoaW5lQWN0aXZpdHlMaWJyYXJ5XFN0YXRlTWFjaGluZVdpdGhEZWNpc2lvbi54YW1sLDED4QESAgEBMwfVAQ8CASx4D7QBFwIBCmwPcBcCAQaqARevAR8CAQLTATnTAUACAS01C0MWAgF1SA9mGAIBVGkPaVUCAU11D3VeAgFGuQEPuQFeAgE/vgEPygEqAgEvehN6cAIBKn8XhQEyAgEijQEXkwEyAgEamwEXpwEyAgEMbhNubwIBCKwBG6wBeAIBBDYNQRYCAXhCDUJmAgF2WRVZYgIBVVwRZRoCAWxKE1UuAgFcwQEVwQFVAgE4xgEVxgFkAgExvgE5vgFBAgEwejB6OwIBK4IBHYIBXQIBJH9Wf14CASOQAR2QAV0CARyNAVaNAV8CARueAR2eAV0CARSjAR2jAWwCAQ6bAUGbAUkCAQ1uMG46AgEJrAE4rAFDAgEFPhM+UwIBejkTOWMCAXlCKkIxAgF3Yz1jQQIBdF8XX2UCAW1NGU1ZAgFlUhlSaAIBXko9SkUCAV0=</sads:DebugSymbol.Symbol>
  </StateMachine>
  <sap2010:WorkflowViewState.ViewStateManager>
    <sap2010:ViewStateManager>
      <sap2010:ViewStateData Id="Assign_1" sap:VirtualizedContainerService.HintSize="242,59" />
      <sap2010:ViewStateData Id="SetUserStatus_1" sap:VirtualizedContainerService.HintSize="242,22" />
      <sap2010:ViewStateData Id="Sequence_1" sap:VirtualizedContainerService.HintSize="264,245">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="SubscribeNotification_4" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="Assign_2" sap:VirtualizedContainerService.HintSize="242,59" />
      <sap2010:ViewStateData Id="Switch`1_1" sap:VirtualizedContainerService.HintSize="473,236">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="SetUserStatus_3" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="State_1" sap:VirtualizedContainerService.HintSize="114,61">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:Point x:Key="ShapeLocation">473,399.5</av:Point>
            <av:Size x:Key="ShapeSize">114,61</av:Size>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="Transition_6" sap:VirtualizedContainerService.HintSize="515,365">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:PointCollection x:Key="ConnectorLocation">147,186.95 581.3,186.95 581.3,399.5</av:PointCollection>
            <x:Int32 x:Key="SrcConnectionPointIndex">32</x:Int32>
            <x:Int32 x:Key="DestConnectionPointIndex">74</x:Int32>
            <x:Boolean x:Key="IsExpanded">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="SetUserStatus_2" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="SubscribeNotification_2" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="Transition_1" sap:VirtualizedContainerService.HintSize="430,493">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:PointCollection x:Key="ConnectorLocation">223,300 90,300 90,220.5</av:PointCollection>
            <x:Int32 x:Key="SrcConnectionPointIndex">37</x:Int32>
            <x:Int32 x:Key="DestConnectionPointIndex">39</x:Int32>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="SubscribeNotification_3" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="Transition_2" sap:VirtualizedContainerService.HintSize="430,493">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:PointCollection x:Key="ConnectorLocation">280,330.5 280,360.5 490.1,360.5 490.1,399.5</av:PointCollection>
            <x:Int32 x:Key="SrcConnectionPointIndex">39</x:Int32>
            <x:Int32 x:Key="DestConnectionPointIndex">10</x:Int32>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="SubscribeNotification_5" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="SetUserStatus_4" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="State_4" sap:VirtualizedContainerService.HintSize="114,61">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:Point x:Key="ShapeLocation">33,449.5</av:Point>
            <av:Size x:Key="ShapeSize">114,61</av:Size>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="Transition_7" sap:VirtualizedContainerService.HintSize="430,493">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:PointCollection x:Key="ConnectorLocation">240.1,330.5 240.1,360.5 112.8,360.5 112.8,449.5</av:PointCollection>
            <x:Int32 x:Key="SrcConnectionPointIndex">11</x:Int32>
            <x:Int32 x:Key="DestConnectionPointIndex">54</x:Int32>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="State_2" sap:VirtualizedContainerService.HintSize="114,61">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:Point x:Key="ShapeLocation">223,269.5</av:Point>
            <av:Size x:Key="ShapeSize">114,61</av:Size>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="Transition_3" sap:VirtualizedContainerService.HintSize="430,265">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:PointCollection x:Key="ConnectorLocation">147,186.95 280,186.95 280,269.5</av:PointCollection>
            <x:Int32 x:Key="SrcConnectionPointIndex">32</x:Int32>
            <x:Int32 x:Key="DestConnectionPointIndex">38</x:Int32>
            <x:Boolean x:Key="IsExpanded">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="Transition_4" sap:VirtualizedContainerService.HintSize="515,469">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:PointCollection x:Key="ConnectorLocation">147,186.95 512.9,186.95 512.9,399.5</av:PointCollection>
            <x:Int32 x:Key="SrcConnectionPointIndex">32</x:Int32>
            <x:Int32 x:Key="DestConnectionPointIndex">26</x:Int32>
            <x:Boolean x:Key="IsExpanded">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="SubscribeNotification_6" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="Transition_8" sap:VirtualizedContainerService.HintSize="430,493">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:PointCollection x:Key="ConnectorLocation">61.5,220.5 61.5,449.5</av:PointCollection>
            <x:Int32 x:Key="SrcConnectionPointIndex">19</x:Int32>
            <x:Int32 x:Key="DestConnectionPointIndex">18</x:Int32>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="State_3" sap:VirtualizedContainerService.HintSize="114,61">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:Point x:Key="ShapeLocation">33,159.5</av:Point>
            <av:Size x:Key="ShapeSize">114,61</av:Size>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="StateMachineWithDecision_1" sap:VirtualizedContainerService.HintSize="614,636">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">False</x:Boolean>
            <av:Point x:Key="ShapeLocation">30,2.5</av:Point>
            <x:Double x:Key="StateContainerWidth">600</x:Double>
            <x:Double x:Key="StateContainerHeight">600</x:Double>
            <av:PointCollection x:Key="ConnectorLocation">33,77.5 33,107.5 95.7,107.5 95.7,159.5</av:PointCollection>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="StateMachineActivityLibrary.StateMachineWithDecision_1" sap:VirtualizedContainerService.HintSize="654,716" />
    </sap2010:ViewStateManager>
  </sap2010:WorkflowViewState.ViewStateManager>
</Activity>